{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2832aad0",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "names=['label','a1','a2','a3','a4','a5','a6','a7','a8','a9','a10','a11','a12','a13']\n",
    "dataset=pd.read_csv(\"wine.data\",names=names)\n",
    "print(\"葡萄酒数据集如下：\")\n",
    "print(dataset)\n",
    "data=dataset.iloc[range(0,178),range(1,14)]\t\n",
    "target=dataset.iloc[range(0,178),range(0,1)]\n",
    "print(f'特征数组的形状：{data.shape}')\n",
    "print(f\"特征数组的形状：{target.shape}\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c4f849af",
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "plt.style.use('seaborn-darkgrid')\n",
    "plt.rcParams['axes.unicode_minus']=False\n",
    "data.plot(kind='box',subplots=True,layout=(3,5),sharex=False,sharey=False)\n",
    "p=data.boxplot(return_type='dict')\t             \n",
    "for i in range(13):\n",
    "    y=p['fliers'][i].get_ydata()\t\t\t\n",
    "    print('a',i+1,'中异常值：',y)\n",
    "plt.show()"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
